//
//  TableTwoByTwoV2.m
//  樓盤王
//
//  Created by Jacky Mok on 7/12/2017.
//  Copyright © 2017 OR Media Limited. All rights reserved.
//

#import "TableTwoByTwoV2.h"
#import "AppDelegate.h"
#import "HomeTable.h"
#import "TableViewCellV2.h"
@implementation TableTwoByTwoV2
@synthesize data1,data2;
-(id) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        delegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
        [self setSelectionStyle:UITableViewCellSelectionStyleNone];
        view1 = [[TableViewCellV2 alloc] initWithFrame:CGRectMake(0,0,delegate.screenWidth/2, HOMEPAGETABLEROW_HEIGHT)];
        view2 = [[TableViewCellV2 alloc] initWithFrame:CGRectMake(delegate.screenWidth/2,0,delegate.screenWidth/2, HOMEPAGETABLEROW_HEIGHT)];
        [view1 setUserInteractionEnabled:YES];
        [view2 setUserInteractionEnabled:YES];
        [self addSubview:view1];
        [self addSubview:view2];
        [self setSelectionStyle:UITableViewCellSelectionStyleNone];

    }
    return self;
}

-(void) redraw {        
    [view1 drawWithData:data1];
    [view2 drawWithData:data2];
    
}
- (void)awakeFromNib {
    // Initialization code
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
